package com.fanqwz.kotlinmvvm.di

import com.fanqwz.kotlinmvvm.MyApplication
import com.fanqwz.kotlinmvvm.di.module.*
import dagger.BindsInstance
import dagger.Component
import dagger.android.AndroidInjectionModule
import dagger.android.AndroidInjector
import dagger.android.support.AndroidSupportInjectionModule
import javax.inject.Singleton

/**
 * Created by fanqwz on 2017/10/25.
 */

@Singleton
@Component(modules = [AndroidInjectionModule::class,
    AndroidSupportInjectionModule::class,
    AppModule::class,
    NetWorkModule::class,
    RepositoryModule::class,
    ViewModelProviderFactoryModule::class,
    ActivityBindingModule::class])
interface AppComponent : AndroidInjector<MyApplication> {


    @Component.Builder
    interface Builder {

        @BindsInstance
        fun application(application: MyApplication): Builder

        //        fun AppModule(appModule: AppModule): Builder
        fun networkModule(networkModule: NetWorkModule): Builder

        fun build(): AppComponent
    }
}